<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ page isELIgnored ="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<script type="text/javascript">
//<![CDATA[
(function(){
	dojo.byId("lbl_properties_new_key").innerHTML = KppModule.commonResource.label;
	$kdom.appendDojoProp("input_properties_new_key","missingMessage",$ksub(KppModule.commonResource.missingMessage,[SysAdmin._resource.properties]));
	$kdom.appendDojoProp("input_properties_new_key","invalidMessage",SysAdmin._resource.invalidKeyString);
	dojo.byId("lbl_properties_new_value").innerHTML = KppModule.commonResource.value;
	dojo.byId("lbl_properties_new_group").innerHTML = KppModule.commonResource.group;
	$kdom.appendDojoProp("input_properties_new_value","missingMessage",$ksub(KppModule.commonResource.missingMessage,[KppModule.commonResource.value]));
	$kdom.appendDojoProp("btn_properties_new_save","label",KppModule.commonResource.save);
	$kdom.appendDojoProp("btn_properties_new_cancel","label",KppModule.commonResource.cancel);
	var groupI18nLabel;
	<c:forEach varStatus="loopStatus" items="${groups}" var="group">
		groupI18nLabel = SysAdmin._resource["propertiesGroup${group.code}"];
    	dojo.byId("opt_properties_new_group${loopStatus.count}").innerHTML = groupI18nLabel?groupI18nLabel:"${group.code}";
	</c:forEach>
})();
//]]>
</script>
<span style="display:none">To solve IE7/8 script event tag problem.</span>
<div data-dojo-type="dijit.form.Form" data-dojo-props="action:'../../config/properties/new.json',id:'frm_properties_new'">
	<table width="100%" cellspacing="10">
		<tr>
			<td><label id="lbl_properties_new_key">properties Key</label></td>
			<td><input id="input_properties_new_key" data-dojo-type="dijit.form.ValidationTextBox" data-dojo-props="required:true,trim:true,name:'key',maxLength:20,regExp:'[a-zA-Z][a-zA-Z0-9\\-_\\.]*'"></input></td>
		</tr>
		<tr>
			<td><label id="lbl_properties_new_value">properties Value</label></td>
			<td><input id="input_properties_new_value" data-dojo-type="dijit.form.ValidationTextBox" data-dojo-props="required:true,trim:true,name:'value'"></input></td>
		</tr>
		<tr>
			<td><label id="lbl_properties_new_group">properties Group</label></td>
			<td>
				<select id="slct_properties_new_group" name="groupcode" data-dojo-type="dijit.form.Select">
				<c:forEach varStatus="loopStatus" items="${groups}" var="group">
				    <option value="${group.code}" ${currentGroup==group.code?'selected="selected"':''} id="opt_properties_new_group${loopStatus.count}">${group.code};</option>
				</c:forEach>
				</select>
			</td>
		</tr>
	</table>
</div>
<div class="dialogFooter">
	<div id="btn_properties_new_save" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconSave', showLabel:true" style="width:70px;">
		<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
			var options = {
				domain:SysAdmin._resource.properties,
				refresh:Properties.refresh,
				refreshArgs:dijit.byId("slct_properties_new_group").get("value"),
				button:this,
				dialogId:Properties._dlgPropertiesNewId,
				formId:"frm_properties_new",
				resource:SysAdmin._resource
			};
			KppModule.restProxy(options).postNew();
		</script>
	</div>
	<div id="btn_properties_new_cancel" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconUndo', showLabel:true" style="width:70px;">
		<script type="dojo/on" data-dojo-event="click" data-dojo-args="evt">
				dijit.byId(Properties._dlgPropertiesNewId).hide();
		</script>
	</div>
</div>